<template>
<div>
   <input type="text" v-model="msg"><br>
  <input type="text" v-model="user.name"><br>
  <input type="text" v-model="user.age"> <br>
</div>
</template>

<script>
export default {
  data(){
  return{
    msg:"小白",
    user:{
      name:'小明',
      age:18,
      gender:"男"
    }
  }
  },
  watch:{
    msg(newVal,oddVal){
      console.log(newVal,oddVal)
    },
    // deep:true,
    // immediate:true,
    user:{
      handler(newVal,addVal){
        console.log(newVal,addVal)
      },
      deep:true,
      immediate:true
    }
    // user(newVal,addVal){
    //   console.log(newVal,addVal)
    // }
    
  }
}
</script>

<style>

</style>